<script src="__PUBLIC__/ganged/Js/city-picker.data.js"></script>
<script src="__PUBLIC__/ganged/Js/city-picker.js"></script>
<script src="__PUBLIC__/ganged/Js/main.js"></script>
<!-- css -->
<link href="__PUBLIC__/ganged/Css/bootstrap.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/uploadify/jquery.uploadify.min.js" ></script>
<link rel="stylesheet" charset="utf-8" type="text/css" href="__PUBLIC__/admin/js/uploadify/uploadify.css"> 
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/upload.js" ></script>
<style>
    .bg {
        background: none;
        border: none;
    }

    .uploadify-button-text {
        display: inline-flex;
    }

    .uploadify-button-text button {
        margin: -10px;
    }

    .upviewer img {
        height: 90px;
        width: 120px;
    }

    .upviewer ul {
        margin: 0px;
        padding: 0px;
    }

    .upviewer li {
        margin: 0px;
        padding: 0px;
        position: relative;
        display: inline-block;
        width: 120px;
        height: 90px;
        background-position: center;
        background-size: contain;
        background-repeat: no-repeat;
        float: left;
        margin-right: 10px;
        border: 1px #ccc solid;
        background-color: #f0f0f0;
    }

    .upviewer li a {
        display: inline-block;
        position: absolute;
        bottom: 0px;
        left: 0px;
        text-align: center;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.3);
        color: red;
        cursor: pointer;
    }

    .upviewer li:hover a {
        background-color: rgba(0, 0, 0, 0.8);
    }
</style>
<div class="container" style="padding-top: 50px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <form class="form-horizontal" role="form" id="post_form" action="{:U('edit')}">

                <div class="form-group">
                    <label for="position" class="col-sm-2 control-label">职位:</label>
                    <div class="col-sm-2">
                        <div class="control-group">
                            <select name="position" id="position" class="form-control"> 
                                <option value="0">请选择职位</option>
                                <volist name="position" id="vo">
                                    <option value="{$key}" <if condition="$info['position'] eq $key">selected</if>>{$vo}</option>
                                </volist>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="education" class="col-sm-2 control-label">学历:</label>
                    <div class="col-sm-2">
                        <div class="control-group">
                            <select name="education" id="education" class="form-control"> 
                                <option value="0">请选择学历</option>
                                <volist name="education" id="vo">
                                    <option value="{$key}" <if condition="$info['education'] eq $key">selected</if>>{$vo}</option>
                                </volist>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="user_name" class="col-sm-2 control-label">姓名:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="user_name" id="user_name" value="{$info.user_name}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="phone" class="col-sm-2 control-label">电话:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="phone" id="phone"  value="{$info.phone}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="age" class="col-sm-2 control-label">年龄:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="age" id="age"  value="{$info.age}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="id_number" class="col-sm-2 control-label">身份证号:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="id_number" id="id_number"  value="{$info.id_number}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="address" class="col-sm-2 control-label">地址:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="address" id="address"  value="{$info.address}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="emergency_1" class="col-sm-2 control-label">紧急联系人1:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="emergency_1" id="emergency_1"  value="{$info.emergency_1}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="emergency_2" class="col-sm-2 control-label">紧急联系人2:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="emergency_2" id="emergency_2"  value="{$info.emergency_2}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="fixed_salary" class="col-sm-2 control-label">固定工资:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="fixed_salary" id="fixed_salary"  value="{$info.fixed_salary}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="commission" class="col-sm-2 control-label">提成:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="commission" id="commission"  value="{$info.commission}"/>
                    </div>
                </div>
				<div class="form-group">
					<label class="col-sm-2 control-label">性别:</label>
					<div class="col-sm-10">
						<label for="sex1" class="control-label">
							<input type="radio" id="sex1" name="sex" value="1" <if condition="$info['sex'] eq 1">checked</if>>男
						</label>
						<label for="sex2" class="control-label">
							<input type="radio" id="sex2" name="sex" value="2"  <if condition="$info['sex'] eq 2">checked</if>>女
						</label>
					</div>
				</div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="hidden" name="id" value="{$info.id}">
                        <button type="button" class="btn btn-primary" id="btn" lng="0" lat="0">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script>
        $(function () {
            $("#btn").click(function () {
                var $form = $("#post_form");
                var $data = {};
                var $form_data = $form.serializeArray();
                $.each($form_data, function (k, v) {
                    $data[v['name']] = v['value'];
                })

                $.post($form.attr('action'), $data, function (obj) {
                    alert(obj.m);
                    if (obj.s) {
                        if (typeof (obj.url) != "undefined" && obj.url) {
                            location.href = obj.url;
                        }
                    }
                })
                return false;
            })
        });
    </script>